package pers.jsan.litheopen.security.config.request;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RequestFilterConfig {

    @Bean
    public FilterRegistrationBean<BodyReaderFilter> bodyReaderFilter() {
        FilterRegistrationBean<BodyReaderFilter> registrationBean = new FilterRegistrationBean<BodyReaderFilter>();
        registrationBean.setFilter(new BodyReaderFilter());
        registrationBean.addUrlPatterns("/*");
        registrationBean.setName("koalaSignFilter");
        registrationBean.setOrder(registrationBean.getOrder()-1);//比其他拦截器稍微早执行
        return registrationBean;
    }
}
